<template>
  <Dialog :title="title" :model-value="visible" width="80%" :before-close="closeForm">
    <empView v-if="visible" :id="id" @load="loadEmp" />
  </Dialog>
</template>

<script>
import { Dialog } from '@/components/Dialog'
import empView from './empView.vue'
export default {
  components: {
    empView,
    Dialog
  },
  props: {
    visible: {
      type: Boolean,
      default: false
    },
    id: {
      type: String,
      default: null
    }
  },
  data() {
    return {
      title: '查看员工信息'
    }
  },
  methods: {
    closeForm() {
      this.$emit('update:visible', false)
      this.$emit('close')
    },
    loadEmp(emp) {
      this.title = '查看员工(' + emp.EmpName + ')资料'
    }
  }
}
</script>
